﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Reporting.API.Application.Commands.RBAC.Users;
using Reporting.Errorcode;

namespace Reporting.API.Controllers
{
    /// <summary>
    /// RBAC  --API
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RBACController : ControllerBase
    {
        private readonly IMediator _mediator;

        public RBACController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 登录 
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> PostLogin([FromBody]LoginUserCommand result)
        {
            return await _mediator.Send(result);
        }


    }
}
